import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Admin from '../views/Admin'
import Xinxi from '../views/Xinxi'
import Care from '../views/Care';

Vue.use(VueRouter)

const routes = [
   {//重定向
    path:"/",
    redirect:'/home'
  },
  {
    path: '/home',
    component: Home,
    // component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/admin',
    component: Admin,
    // component: () => import(/* webpackChunkName: "Admin" */ '../views/Admin')
    children:[
      {
        path:'xinxi',
        component: Xinxi,
      //   // component: () => import(/* webpackChunkName: "about" */ '../views/Admin/Xinxi')
      },
      {
        path: 'care',
        component: Care,
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
